<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>misc/syntax/lua.syntax</title>
<meta name='robots' content='noindex,nofollow' />
<meta name='generator' content='GLOBAL-6.5.7' />
<meta http-equiv='Content-Style-Type' content='text/css' />
<link rel='stylesheet' type='text/css' href='../style.css' />
</head>
<body>
<!-- beginning of fixed guide -->
<div id='guide'><ul>
<li><a href='#TOP'><img class='icon' src='../icons/first.png' alt='[^]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/last.png' alt='[v]' /></a></li>
<li><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a></li>
<li><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a></li>
<li><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a></li>
<li class='standout'><span><a href='../files/misc.html'>misc</a>/<a href='../files/misc--syntax.html'>syntax</a>/lua.syntax</span></li>
</ul></div>
<!-- end of fixed guide -->
<a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/misc.html'>misc</a>/<a href='../files/misc--syntax.html'>syntax</a>/lua.syntax</h2>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><img class='icon' src='../icons/n_top.png' alt='[top]' /><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+1 misc/syntax/lua.syntax'  /> */</em>
<hr />
<pre>
<a id='L1' name='L1'></a>#
<a id='L2' name='L2'></a># Lua syntax highlighting
<a id='L3' name='L3'></a>#
<a id='L4' name='L4'></a># History:
<a id='L5' name='L5'></a>#
<a id='L6' name='L6'></a># - 2015: Support for long strings and long comments.
<a id='L7' name='L7'></a># - 2011: String-literal fixes.
<a id='L8' name='L8'></a># - 2005: Started by Mike Gorchak &lt;lestat@i.com.ua&gt;
<a id='L9' name='L9'></a> 
<a id='L10' name='L10'></a>context default lightgray
<a id='L11' name='L11'></a> 
<a id='L12' name='L12'></a># keywords
<a id='L13' name='L13'></a>    keyword whole and white
<a id='L14' name='L14'></a>    keyword whole break white
<a id='L15' name='L15'></a>    keyword whole do white
<a id='L16' name='L16'></a>    keyword whole else white
<a id='L17' name='L17'></a>    keyword whole elseif white
<a id='L18' name='L18'></a>    keyword whole end white
<a id='L19' name='L19'></a>    keyword whole false white
<a id='L20' name='L20'></a>    keyword whole for white
<a id='L21' name='L21'></a>    keyword whole function white
<a id='L22' name='L22'></a>    keyword whole if white
<a id='L23' name='L23'></a>    keyword whole in white
<a id='L24' name='L24'></a>    keyword whole local white
<a id='L25' name='L25'></a>    keyword whole nil white
<a id='L26' name='L26'></a>    keyword whole not white
<a id='L27' name='L27'></a>    keyword whole or white
<a id='L28' name='L28'></a>    keyword whole repeat white
<a id='L29' name='L29'></a>    keyword whole return white
<a id='L30' name='L30'></a>    keyword whole then white
<a id='L31' name='L31'></a>    keyword whole true white
<a id='L32' name='L32'></a>    keyword whole until white
<a id='L33' name='L33'></a>    keyword whole while white
<a id='L34' name='L34'></a> 
<a id='L35' name='L35'></a># Comment and string delimiters
<a id='L36' name='L36'></a>    keyword -- brown
<a id='L37' name='L37'></a>    keyword ]\[=\]] brown
<a id='L38' name='L38'></a>    # The following colorizes the start delimiter of "long" strings.
<a id='L39' name='L39'></a>    # The start delimiter of "long" comments isn't affected by the following
<a id='L40' name='L40'></a>    # directive but gets its color from the "--" above (gods know why).
<a id='L41' name='L41'></a>    keyword [\[=\][ brown
<a id='L42' name='L42'></a> 
<a id='L43' name='L43'></a># Operators
<a id='L44' name='L44'></a>    keyword ( white
<a id='L45' name='L45'></a>    keyword ) white
<a id='L46' name='L46'></a>    keyword { white
<a id='L47' name='L47'></a>    keyword } white
<a id='L48' name='L48'></a>    keyword [ white
<a id='L49' name='L49'></a>    keyword ] white
<a id='L50' name='L50'></a>    keyword . white
<a id='L51' name='L51'></a>    keyword , white
<a id='L52' name='L52'></a>    keyword ; white
<a id='L53' name='L53'></a>    keyword : white
<a id='L54' name='L54'></a>    keyword .. white
<a id='L55' name='L55'></a>    keyword ... white
<a id='L56' name='L56'></a>    keyword = white
<a id='L57' name='L57'></a>    keyword == white
<a id='L58' name='L58'></a>    keyword ~= white
<a id='L59' name='L59'></a>    keyword &lt;= white
<a id='L60' name='L60'></a>    keyword =&gt; white
<a id='L61' name='L61'></a>    keyword &gt; white
<a id='L62' name='L62'></a>    keyword &lt; white
<a id='L63' name='L63'></a>    keyword \+ white
<a id='L64' name='L64'></a>    keyword - white
<a id='L65' name='L65'></a>    keyword \* white
<a id='L66' name='L66'></a>    keyword / white
<a id='L67' name='L67'></a>    keyword ^ white
<a id='L68' name='L68'></a> 
<a id='L69' name='L69'></a> 
<a id='L70' name='L70'></a># Library Functions
<a id='L71' name='L71'></a> 
<a id='L72' name='L72'></a>    # basiclib
<a id='L73' name='L73'></a>    keyword whole error yellow
<a id='L74' name='L74'></a>    keyword whole getmetatable yellow
<a id='L75' name='L75'></a>    keyword whole setmetatable yellow
<a id='L76' name='L76'></a>    keyword whole getfenv yellow
<a id='L77' name='L77'></a>    keyword whole setfenv yellow
<a id='L78' name='L78'></a>    keyword whole next yellow
<a id='L79' name='L79'></a>    keyword whole ipairs yellow
<a id='L80' name='L80'></a>    keyword whole pairs yellow
<a id='L81' name='L81'></a>    keyword whole print yellow
<a id='L82' name='L82'></a>    keyword whole tonumber yellow
<a id='L83' name='L83'></a>    keyword whole tostring yellow
<a id='L84' name='L84'></a>    keyword whole type yellow
<a id='L85' name='L85'></a>    keyword whole assert yellow
<a id='L86' name='L86'></a>    #keyword whole unpack yellow    # modern code should use table.unpack()
<a id='L87' name='L87'></a>    keyword whole rawequal yellow
<a id='L88' name='L88'></a>    keyword whole rawget yellow
<a id='L89' name='L89'></a>    keyword whole rawset yellow
<a id='L90' name='L90'></a>    keyword whole pcall yellow
<a id='L91' name='L91'></a>    keyword whole xpcall yellow
<a id='L92' name='L92'></a>    keyword whole collectgarbage yellow
<a id='L93' name='L93'></a>    keyword whole gcinfo yellow
<a id='L94' name='L94'></a>    keyword whole loadfile yellow
<a id='L95' name='L95'></a>    keyword whole dofile yellow
<a id='L96' name='L96'></a>    keyword whole loadstring yellow
<a id='L97' name='L97'></a>    keyword whole require yellow
<a id='L98' name='L98'></a>    keyword whole coroutine.create yellow
<a id='L99' name='L99'></a>    keyword whole coroutine.wrap yellow
<a id='L100' name='L100'></a>    keyword whole coroutine.resume yellow
<a id='L101' name='L101'></a>    keyword whole coroutine.yield yellow
<a id='L102' name='L102'></a>    keyword whole coroutine.status yellow
<a id='L103' name='L103'></a> 
<a id='L104' name='L104'></a>    # stringlib
<a id='L105' name='L105'></a>    keyword whole string.len yellow
<a id='L106' name='L106'></a>    keyword whole string.sub yellow
<a id='L107' name='L107'></a>    keyword whole string.lower yellow
<a id='L108' name='L108'></a>    keyword whole string.upper yellow
<a id='L109' name='L109'></a>    keyword whole string.char yellow
<a id='L110' name='L110'></a>    keyword whole string.rep yellow
<a id='L111' name='L111'></a>    keyword whole string.byte yellow
<a id='L112' name='L112'></a>    keyword whole string.format yellow
<a id='L113' name='L113'></a>    keyword whole string.dump yellow
<a id='L114' name='L114'></a>    keyword whole string.find yellow
<a id='L115' name='L115'></a>    keyword whole string.gfind yellow
<a id='L116' name='L116'></a>    keyword whole string.gsub yellow
<a id='L117' name='L117'></a> 
<a id='L118' name='L118'></a>    # tablelib
<a id='L119' name='L119'></a>    keyword whole table.concat yellow
<a id='L120' name='L120'></a>    keyword whole table.foreach yellow
<a id='L121' name='L121'></a>    keyword whole table.foreachi yellow
<a id='L122' name='L122'></a>    keyword whole table.getn yellow
<a id='L123' name='L123'></a>    keyword whole table.setn yellow
<a id='L124' name='L124'></a>    keyword whole table.sort yellow
<a id='L125' name='L125'></a>    keyword whole table.insert yellow
<a id='L126' name='L126'></a>    keyword whole table.remove yellow
<a id='L127' name='L127'></a>    keyword whole table.unpack yellow
<a id='L128' name='L128'></a> 
<a id='L129' name='L129'></a>    # mathlib
<a id='L130' name='L130'></a>    keyword whole math.abs yellow
<a id='L131' name='L131'></a>    keyword whole math.sin yellow
<a id='L132' name='L132'></a>    keyword whole math.cos yellow
<a id='L133' name='L133'></a>    keyword whole math.tan yellow
<a id='L134' name='L134'></a>    keyword whole math.asin yellow
<a id='L135' name='L135'></a>    keyword whole math.acos yellow
<a id='L136' name='L136'></a>    keyword whole math.atan yellow
<a id='L137' name='L137'></a>    keyword whole math.atan2 yellow
<a id='L138' name='L138'></a>    keyword whole math.ceil yellow
<a id='L139' name='L139'></a>    keyword whole math.floor yellow
<a id='L140' name='L140'></a>    keyword whole math.mod yellow
<a id='L141' name='L141'></a>    keyword whole math.frexp yellow
<a id='L142' name='L142'></a>    keyword whole math.ldexp yellow
<a id='L143' name='L143'></a>    keyword whole math.sqrt yellow
<a id='L144' name='L144'></a>    keyword whole math.min yellow
<a id='L145' name='L145'></a>    keyword whole math.max yellow
<a id='L146' name='L146'></a>    keyword whole math.log yellow
<a id='L147' name='L147'></a>    keyword whole math.log10 yellow
<a id='L148' name='L148'></a>    keyword whole math.exp yellow
<a id='L149' name='L149'></a>    keyword whole math.deg yellow
<a id='L150' name='L150'></a>    keyword whole math.pow yellow
<a id='L151' name='L151'></a>    keyword whole math.rad yellow
<a id='L152' name='L152'></a>    keyword whole math.random yellow
<a id='L153' name='L153'></a>    keyword whole math.randomseed yellow
<a id='L154' name='L154'></a> 
<a id='L155' name='L155'></a>    # iolib
<a id='L156' name='L156'></a>    keyword whole io.input yellow
<a id='L157' name='L157'></a>    keyword whole io.output yellow
<a id='L158' name='L158'></a>    keyword whole io.lines yellow
<a id='L159' name='L159'></a>    keyword whole io.close yellow
<a id='L160' name='L160'></a>    keyword whole io.flush yellow
<a id='L161' name='L161'></a>    keyword whole io.open yellow
<a id='L162' name='L162'></a>    keyword whole io.popen yellow
<a id='L163' name='L163'></a>    keyword whole io.read yellow
<a id='L164' name='L164'></a>    keyword whole io.tmpfile yellow
<a id='L165' name='L165'></a>    keyword whole io.type yellow
<a id='L166' name='L166'></a>    keyword whole io.write yellow
<a id='L167' name='L167'></a> 
<a id='L168' name='L168'></a>    # filelib
<a id='L169' name='L169'></a>    keyword whole file.flush yellow
<a id='L170' name='L170'></a>    keyword whole file.read yellow
<a id='L171' name='L171'></a>    keyword whole file.lines yellow
<a id='L172' name='L172'></a>    keyword whole file.seek yellow
<a id='L173' name='L173'></a>    keyword whole file.write yellow
<a id='L174' name='L174'></a>    keyword whole file.close yellow
<a id='L175' name='L175'></a>    keyword whole file.__gc yellow
<a id='L176' name='L176'></a>    keyword whole file.__tostring yellow
<a id='L177' name='L177'></a> 
<a id='L178' name='L178'></a>    # syslib
<a id='L179' name='L179'></a>    keyword whole os.clock yellow
<a id='L180' name='L180'></a>    keyword whole os.date yellow
<a id='L181' name='L181'></a>    keyword whole os.difftime yellow
<a id='L182' name='L182'></a>    keyword whole os.execute yellow
<a id='L183' name='L183'></a>    keyword whole os.exit yellow
<a id='L184' name='L184'></a>    keyword whole os.getenv yellow
<a id='L185' name='L185'></a>    keyword whole os.remove yellow
<a id='L186' name='L186'></a>    keyword whole os.rename yellow
<a id='L187' name='L187'></a>    keyword whole os.setlocale yellow
<a id='L188' name='L188'></a>    keyword whole os.time yellow
<a id='L189' name='L189'></a>    keyword whole os.tmpname yellow
<a id='L190' name='L190'></a> 
<a id='L191' name='L191'></a>    # debuglib
<a id='L192' name='L192'></a>    keyword whole debug.getlocal yellow
<a id='L193' name='L193'></a>    keyword whole debug.getinfo yellow
<a id='L194' name='L194'></a>    keyword whole debug.gethook yellow
<a id='L195' name='L195'></a>    keyword whole debug.getupvalue yellow
<a id='L196' name='L196'></a>    keyword whole debug.sethook yellow
<a id='L197' name='L197'></a>    keyword whole debug.setlocal yellow
<a id='L198' name='L198'></a>    keyword whole debug.setupvalue yellow
<a id='L199' name='L199'></a>    keyword whole debug.debug yellow
<a id='L200' name='L200'></a>    keyword whole debug.traceback yellow
<a id='L201' name='L201'></a> 
<a id='L202' name='L202'></a> 
<a id='L203' name='L203'></a># Global Variables
<a id='L204' name='L204'></a>    keyword whole _VERSION brightmagenta
<a id='L205' name='L205'></a>    keyword whole _G brightmagenta
<a id='L206' name='L206'></a> 
<a id='L207' name='L207'></a>#
<a id='L208' name='L208'></a># Long comments
<a id='L209' name='L209'></a>#
<a id='L210' name='L210'></a> 
<a id='L211' name='L211'></a>context exclusive --[[ ]] brown
<a id='L212' name='L212'></a>    # hightlights ldoc tags: "@todo", "@param", "@function" etc.
<a id='L213' name='L213'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L214' name='L214'></a>    spellcheck
<a id='L215' name='L215'></a>context exclusive --[=[ ]=] brown
<a id='L216' name='L216'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L217' name='L217'></a>    spellcheck
<a id='L218' name='L218'></a>context exclusive --[==[ ]==] brown
<a id='L219' name='L219'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L220' name='L220'></a>    spellcheck
<a id='L221' name='L221'></a>context exclusive --[===[ ]===] brown
<a id='L222' name='L222'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L223' name='L223'></a>    spellcheck
<a id='L224' name='L224'></a># 4 equals and up (the number of ='s doesn't have to match, but that's the best we can do):
<a id='L225' name='L225'></a>context exclusive --[====\[=\][ ]====\[=\]] brown
<a id='L226' name='L226'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L227' name='L227'></a>    spellcheck
<a id='L228' name='L228'></a> 
<a id='L229' name='L229'></a>#
<a id='L230' name='L230'></a># Long strings
<a id='L231' name='L231'></a>#
<a id='L232' name='L232'></a> 
<a id='L233' name='L233'></a>context exclusive [[ ]] brightmagenta
<a id='L234' name='L234'></a>    spellcheck
<a id='L235' name='L235'></a>context exclusive [=[ ]=] brightmagenta
<a id='L236' name='L236'></a>    spellcheck
<a id='L237' name='L237'></a>context exclusive [==[ ]==] brightmagenta
<a id='L238' name='L238'></a>    spellcheck
<a id='L239' name='L239'></a>context exclusive [===[ ]===] brightmagenta
<a id='L240' name='L240'></a>    spellcheck
<a id='L241' name='L241'></a># 4 equals and up (the number of ='s doesn't have to match, but that's the best we can do):
<a id='L242' name='L242'></a>context exclusive [====\[=\][ ]====\[=\]] brightmagenta
<a id='L243' name='L243'></a>    spellcheck
<a id='L244' name='L244'></a> 
<a id='L245' name='L245'></a> 
<a id='L246' name='L246'></a># Simple comments
<a id='L247' name='L247'></a>context exclusive -- \n brown
<a id='L248' name='L248'></a>    keyword @\[abcdefghijklmnopqrstuvwxyz\] brightred base
<a id='L249' name='L249'></a>    spellcheck
<a id='L250' name='L250'></a> 
<a id='L251' name='L251'></a># Shebang line
<a id='L252' name='L252'></a>context linestart #! \n brown
<a id='L253' name='L253'></a> 
<a id='L254' name='L254'></a># Strings
<a id='L255' name='L255'></a>context " " green
<a id='L256' name='L256'></a>    keyword %a brightgreen
<a id='L257' name='L257'></a>    keyword %c brightgreen
<a id='L258' name='L258'></a>    keyword %d brightgreen
<a id='L259' name='L259'></a>    keyword %l brightgreen
<a id='L260' name='L260'></a>    keyword %p brightgreen
<a id='L261' name='L261'></a>    keyword %q brightgreen
<a id='L262' name='L262'></a>    keyword %s brightgreen
<a id='L263' name='L263'></a>    keyword %u brightgreen
<a id='L264' name='L264'></a>    keyword %w brightgreen
<a id='L265' name='L265'></a>    keyword %x brightgreen
<a id='L266' name='L266'></a>    keyword %z brightgreen
<a id='L267' name='L267'></a>    keyword \\\\ brightgreen
<a id='L268' name='L268'></a>    keyword \\" brightgreen
<a id='L269' name='L269'></a>    keyword \\' brightgreen
<a id='L270' name='L270'></a>    keyword \\\{abtnvfr\} brightgreen
<a id='L271' name='L271'></a>    keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
<a id='L272' name='L272'></a>    keyword \\\{01234567\}\{01234567\} brightgreen
<a id='L273' name='L273'></a>    keyword \\\{01234567\} brightgreen
<a id='L274' name='L274'></a>    spellcheck
<a id='L275' name='L275'></a> 
<a id='L276' name='L276'></a>context ' ' green
<a id='L277' name='L277'></a>    keyword %a brightgreen
<a id='L278' name='L278'></a>    keyword %c brightgreen
<a id='L279' name='L279'></a>    keyword %d brightgreen
<a id='L280' name='L280'></a>    keyword %l brightgreen
<a id='L281' name='L281'></a>    keyword %p brightgreen
<a id='L282' name='L282'></a>    keyword %q brightgreen
<a id='L283' name='L283'></a>    keyword %s brightgreen
<a id='L284' name='L284'></a>    keyword %u brightgreen
<a id='L285' name='L285'></a>    keyword %w brightgreen
<a id='L286' name='L286'></a>    keyword %x brightgreen
<a id='L287' name='L287'></a>    keyword %z brightgreen
<a id='L288' name='L288'></a>    keyword \\\\ brightgreen
<a id='L289' name='L289'></a>    keyword \\" brightgreen
<a id='L290' name='L290'></a>    keyword \\' brightgreen
<a id='L291' name='L291'></a>    keyword \\\{abtnvfr\} brightgreen
<a id='L292' name='L292'></a>    keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
<a id='L293' name='L293'></a>    keyword \\\{01234567\}\{01234567\} brightgreen
<a id='L294' name='L294'></a>    keyword \\\{01234567\} brightgreen
<a id='L295' name='L295'></a>    spellcheck
</pre>
<hr />
<a id='BOTTOM' name='BOTTOM'></a>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><img class='icon' src='../icons/n_bottom.png' alt='[bottom]' /><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+295 misc/syntax/lua.syntax'  /> */</em>
</body>
</html>
